
import java.util.Arrays;

public class Main {
    public static void main(String[] args) {
       int[] array={1,22,44,55,6,7};
       func(array);
        System.out.println(Arrays.toString(array));
    }
    public static void func(int[] array1) {
        for (int i = 0; i < array1.length - 1; i++) {
            for (int j = 0; j < array1.length - i-1; j++) {
                if ((array1[j] % 2) == 0&&(array1[j+1]%2!=0)) {
                    int tmp = array1[j];
                    array1[j] = array1[j+1];
                    array1[j+1] = tmp;
                }
            }
        }
    }
}